<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>RT-Thread RTOS: Thread Management</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RT-Thread RTOS
   &#160;<span id="projectnumber">1.2.0</span>
   </div>
   <div id="projectbrief">An open source embedded real-time operating system</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___thread.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Thread Management<div class="ingroups"><a class="el" href="group___kernel.html">RT-Thread Kernel API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__thread.html">rt_thread</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gae743a0f57a34ce46c0687ff787972ded"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gae743a0f57a34ce46c0687ff787972ded">RT_THREAD_INIT</a>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:gae743a0f57a34ce46c0687ff787972ded"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d2482a36a666c7e796f0fee67c0d3f3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga3d2482a36a666c7e796f0fee67c0d3f3">RT_THREAD_READY</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:ga3d2482a36a666c7e796f0fee67c0d3f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad67bab390563b8b80a2ee7a847660f85"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gad67bab390563b8b80a2ee7a847660f85">RT_THREAD_SUSPEND</a>&#160;&#160;&#160;0x02</td></tr>
<tr class="separator:gad67bab390563b8b80a2ee7a847660f85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76fc51507d2201f644b94b916560778b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga76fc51507d2201f644b94b916560778b">RT_THREAD_RUNNING</a>&#160;&#160;&#160;0x03</td></tr>
<tr class="separator:ga76fc51507d2201f644b94b916560778b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga85729ec69f5f51133e5d1e218f1bd504"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga85729ec69f5f51133e5d1e218f1bd504">RT_THREAD_BLOCK</a>&#160;&#160;&#160;<a class="el" href="group___thread.html#gad67bab390563b8b80a2ee7a847660f85">RT_THREAD_SUSPEND</a></td></tr>
<tr class="separator:ga85729ec69f5f51133e5d1e218f1bd504"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c39773ce3aefe35d15e68f34ddedc9a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga1c39773ce3aefe35d15e68f34ddedc9a">RT_THREAD_CLOSE</a>&#160;&#160;&#160;0x04</td></tr>
<tr class="separator:ga1c39773ce3aefe35d15e68f34ddedc9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae94f55354bd0e145bd855bd38db5c442"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gae94f55354bd0e145bd855bd38db5c442">RT_THREAD_CTRL_STARTUP</a>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:gae94f55354bd0e145bd855bd38db5c442"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad875eaaa2400aef8f6078f5d1f8297b3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gad875eaaa2400aef8f6078f5d1f8297b3">RT_THREAD_CTRL_CLOSE</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:gad875eaaa2400aef8f6078f5d1f8297b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad59e5c8ec96f8b3231947b0c665e5fba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gad59e5c8ec96f8b3231947b0c665e5fba">RT_THREAD_CTRL_CHANGE_PRIORITY</a>&#160;&#160;&#160;0x02</td></tr>
<tr class="separator:gad59e5c8ec96f8b3231947b0c665e5fba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45ba1445796c920c2ae943b419e19d4b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga45ba1445796c920c2ae943b419e19d4b">RT_THREAD_CTRL_INFO</a>&#160;&#160;&#160;0x03</td></tr>
<tr class="separator:ga45ba1445796c920c2ae943b419e19d4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9c10243ac4c20396787df151ea13f4eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga9c10243ac4c20396787df151ea13f4eb">rt_thread_idle_excute</a> (void)</td></tr>
<tr class="separator:ga9c10243ac4c20396787df151ea13f4eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae9f99bb5e2e2032b10ddda7a03eefe24"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gae9f99bb5e2e2032b10ddda7a03eefe24">rt_schedule</a> (void)</td></tr>
<tr class="separator:gae9f99bb5e2e2032b10ddda7a03eefe24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac4c796a7c2031213d9d2416c6e4a5b6a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gac4c796a7c2031213d9d2416c6e4a5b6a">rt_enter_critical</a> (void)</td></tr>
<tr class="separator:gac4c796a7c2031213d9d2416c6e4a5b6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35c56c2d56e2bb0f2df95abc752143df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga35c56c2d56e2bb0f2df95abc752143df">rt_exit_critical</a> (void)</td></tr>
<tr class="separator:ga35c56c2d56e2bb0f2df95abc752143df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3f894e8efadefda238a5e5ab45c7e21"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga5acba55f46553417996ac70828b874da">rt_uint16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gaf3f894e8efadefda238a5e5ab45c7e21">rt_critical_level</a> (void)</td></tr>
<tr class="separator:gaf3f894e8efadefda238a5e5ab45c7e21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacd985aa60939b95e510f144610f001b9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gacd985aa60939b95e510f144610f001b9">rt_thread_init</a> (struct <a class="el" href="structrt__thread.html">rt_thread</a> *thread, const char *name, void(*entry)(void *parameter), void *parameter, void *stack_start, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> stack_size, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> priority, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> tick)</td></tr>
<tr class="separator:gacd985aa60939b95e510f144610f001b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6133c1b6b27d972447156db15e7c1ce7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga6133c1b6b27d972447156db15e7c1ce7">rt_thread_self</a> (void)</td></tr>
<tr class="separator:ga6133c1b6b27d972447156db15e7c1ce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga04b743537fd099e204fc292e57b4aa5a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga04b743537fd099e204fc292e57b4aa5a">rt_thread_startup</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread)</td></tr>
<tr class="separator:ga04b743537fd099e204fc292e57b4aa5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga514825b80304477ecf377d721da409b0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga514825b80304477ecf377d721da409b0">rt_thread_detach</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread)</td></tr>
<tr class="separator:ga514825b80304477ecf377d721da409b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb215b161f17c26b5e19c28cd0119e7b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gacb215b161f17c26b5e19c28cd0119e7b">rt_thread_create</a> (const char *name, void(*entry)(void *parameter), void *parameter, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> stack_size, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> priority, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> tick)</td></tr>
<tr class="separator:gacb215b161f17c26b5e19c28cd0119e7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d64eb4d0a485461049616808f4ce177"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga6d64eb4d0a485461049616808f4ce177">rt_thread_delete</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread)</td></tr>
<tr class="separator:ga6d64eb4d0a485461049616808f4ce177"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5703a0d7351b37a1c00874a362626ea3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga5703a0d7351b37a1c00874a362626ea3">rt_thread_yield</a> (void)</td></tr>
<tr class="separator:ga5703a0d7351b37a1c00874a362626ea3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga540da4c76db4f081b668766042e7490e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga540da4c76db4f081b668766042e7490e">rt_thread_sleep</a> (<a class="el" href="group___basic_def.html#ga66c400929925784dba020d671154978a">rt_tick_t</a> tick)</td></tr>
<tr class="separator:ga540da4c76db4f081b668766042e7490e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b18459cac67e3695447e69b997fc74e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga6b18459cac67e3695447e69b997fc74e">rt_thread_delay</a> (<a class="el" href="group___basic_def.html#ga66c400929925784dba020d671154978a">rt_tick_t</a> tick)</td></tr>
<tr class="separator:ga6b18459cac67e3695447e69b997fc74e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec4d1d7bababdead1e82fa880ac1c6ea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gaec4d1d7bababdead1e82fa880ac1c6ea">rt_thread_control</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:gaec4d1d7bababdead1e82fa880ac1c6ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab75228a43588dc35570bce6a2c18f3f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gab75228a43588dc35570bce6a2c18f3f0">rt_thread_suspend</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread)</td></tr>
<tr class="separator:gab75228a43588dc35570bce6a2c18f3f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab4f29aff4fec96d92f6321fa7b00c379"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gab4f29aff4fec96d92f6321fa7b00c379">rt_thread_resume</a> (<a class="el" href="structrt__thread.html">rt_thread_t</a> thread)</td></tr>
<tr class="separator:gab4f29aff4fec96d92f6321fa7b00c379"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a0288d712bd2d99d11231d4b073c5f3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga8a0288d712bd2d99d11231d4b073c5f3">rt_thread_timeout</a> (void *parameter)</td></tr>
<tr class="separator:ga8a0288d712bd2d99d11231d4b073c5f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga789a0782597b4d7f7c6c16eacc6084a8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga789a0782597b4d7f7c6c16eacc6084a8">rt_thread_find</a> (char *name)</td></tr>
<tr class="separator:ga789a0782597b4d7f7c6c16eacc6084a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0dcacf89c3d97272b185f7162a3e0c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#gae0dcacf89c3d97272b185f7162a3e0c3">rt_thread_idle_init</a> (void)</td></tr>
<tr class="separator:gae0dcacf89c3d97272b185f7162a3e0c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga47689b07705c1e7892f6ec397152e9ac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga47689b07705c1e7892f6ec397152e9ac">rt_thread_idle_sethook</a> (void(*hook)(void))</td></tr>
<tr class="separator:ga47689b07705c1e7892f6ec397152e9ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5aa2c0c67999e20ce8693ad3c8e624f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga5aa2c0c67999e20ce8693ad3c8e624f0">rt_system_scheduler_init</a> (void)</td></tr>
<tr class="separator:ga5aa2c0c67999e20ce8693ad3c8e624f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9aa8a561e0caf5e13126834c4f4bb681"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___thread.html#ga9aa8a561e0caf5e13126834c4f4bb681">rt_system_scheduler_start</a> (void)</td></tr>
<tr class="separator:ga9aa8a561e0caf5e13126834c4f4bb681"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>RT-Thread operating system supports multitask systems, which are based on thread scheduling.</p>
<ul>
<li>The scheduling is a full preemptive priority-based scheduling algorithm.</li>
<li>8/32/256 priority levels are supported, in which 0 is the highest and 7/31/255 the lowest. The 7/31/255th priority is used for idle thread.</li>
<li>Threads running at same priority level are supported. The shared time-slice round-robin scheduling is used for this case.</li>
<li>The time of scheduler to choose the next highest ready thread is determinant.</li>
<li>There are four status in thread management<ol type="1">
<li>Initialization</li>
<li>Running/Ready</li>
<li>Blocked</li>
<li>Closed</li>
</ol>
</li>
<li>The number of threads in the system is unlimited, only related with RAM. </li>
</ul>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gae743a0f57a34ce46c0687ff787972ded"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_INIT&#160;&#160;&#160;0x00</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialized status </p>

</div>
</div>
<a class="anchor" id="ga3d2482a36a666c7e796f0fee67c0d3f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_READY&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Ready status </p>

</div>
</div>
<a class="anchor" id="gad67bab390563b8b80a2ee7a847660f85"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_SUSPEND&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Suspend status </p>

</div>
</div>
<a class="anchor" id="ga76fc51507d2201f644b94b916560778b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_RUNNING&#160;&#160;&#160;0x03</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Running status </p>

</div>
</div>
<a class="anchor" id="ga85729ec69f5f51133e5d1e218f1bd504"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_BLOCK&#160;&#160;&#160;<a class="el" href="group___thread.html#gad67bab390563b8b80a2ee7a847660f85">RT_THREAD_SUSPEND</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Blocked status </p>

</div>
</div>
<a class="anchor" id="ga1c39773ce3aefe35d15e68f34ddedc9a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_CLOSE&#160;&#160;&#160;0x04</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Closed status </p>

</div>
</div>
<a class="anchor" id="gae94f55354bd0e145bd855bd38db5c442"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_CTRL_STARTUP&#160;&#160;&#160;0x00</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>thread control command definitionsStartup thread. </p>

</div>
</div>
<a class="anchor" id="gad875eaaa2400aef8f6078f5d1f8297b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_CTRL_CLOSE&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Close thread. </p>

</div>
</div>
<a class="anchor" id="gad59e5c8ec96f8b3231947b0c665e5fba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_CTRL_CHANGE_PRIORITY&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Change thread priority. </p>

</div>
</div>
<a class="anchor" id="ga45ba1445796c920c2ae943b419e19d4b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_THREAD_CTRL_INFO&#160;&#160;&#160;0x03</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get thread information. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga9c10243ac4c20396787df151ea13f4eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_thread_idle_excute </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will perform system background job when system idle. </p>

</div>
</div>
<a class="anchor" id="gae9f99bb5e2e2032b10ddda7a03eefe24"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_schedule </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will perform one schedule. It will select one thread with the highest priority level, then switch to it. </p>

</div>
</div>
<a class="anchor" id="gac4c796a7c2031213d9d2416c6e4a5b6a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_enter_critical </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will lock the thread scheduler. </p>

</div>
</div>
<a class="anchor" id="ga35c56c2d56e2bb0f2df95abc752143df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_exit_critical </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will unlock the thread scheduler. </p>

</div>
</div>
<a class="anchor" id="gaf3f894e8efadefda238a5e5ab45c7e21"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga5acba55f46553417996ac70828b874da">rt_uint16_t</a> rt_critical_level </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the scheduler lock level</p>
<dl class="section return"><dt>Returns</dt><dd>the level of the scheduler lock. 0 means unlocked. </dd></dl>

</div>
</div>
<a class="anchor" id="gacd985aa60939b95e510f144610f001b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_init </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structrt__thread.html">rt_thread</a> *&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *parameter)&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>parameter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>stack_start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>stack_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>tick</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize a thread, normally it's used to initialize a static thread object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the static thread object </td></tr>
    <tr><td class="paramname">name</td><td>the name of thread, which shall be unique </td></tr>
    <tr><td class="paramname">entry</td><td>the entry function of thread </td></tr>
    <tr><td class="paramname">parameter</td><td>the parameter of thread enter function </td></tr>
    <tr><td class="paramname">stack_start</td><td>the start address of thread stack </td></tr>
    <tr><td class="paramname">stack_size</td><td>the size of thread stack </td></tr>
    <tr><td class="paramname">priority</td><td>the priority of thread </td></tr>
    <tr><td class="paramname">tick</td><td>the time slice if there are same priority thread</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga6133c1b6b27d972447156db15e7c1ce7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__thread.html">rt_thread_t</a> rt_thread_self </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will return self thread object</p>
<dl class="section return"><dt>Returns</dt><dd>the self thread object </dd></dl>

</div>
</div>
<a class="anchor" id="ga04b743537fd099e204fc292e57b4aa5a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_startup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will start a thread and put it to system ready queue</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the thread to be started</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga514825b80304477ecf377d721da409b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a thread. The thread object will be removed from thread queue and detached/deleted from system object management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the thread to be deleted</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error </dd></dl>

</div>
</div>
<a class="anchor" id="gacb215b161f17c26b5e19c28cd0119e7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__thread.html">rt_thread_t</a> rt_thread_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *parameter)&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>parameter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>stack_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>tick</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create a thread object and allocate thread object memory and stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of thread, which shall be unique </td></tr>
    <tr><td class="paramname">entry</td><td>the entry function of thread </td></tr>
    <tr><td class="paramname">parameter</td><td>the parameter of thread enter function </td></tr>
    <tr><td class="paramname">stack_size</td><td>the size of thread stack </td></tr>
    <tr><td class="paramname">priority</td><td>the priority of thread </td></tr>
    <tr><td class="paramname">tick</td><td>the time slice if there are same priority thread</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created thread object </dd></dl>

</div>
</div>
<a class="anchor" id="ga6d64eb4d0a485461049616808f4ce177"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete a thread. The thread object will be removed from thread queue and detached/deleted from system object management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the thread to be deleted</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga5703a0d7351b37a1c00874a362626ea3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_yield </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will let current thread yield processor, and scheduler will choose a highest thread to run. After yield processor, the current thread is still in READY state.</p>
<dl class="section return"><dt>Returns</dt><dd>RT_EOK </dd></dl>

</div>
</div>
<a class="anchor" id="ga540da4c76db4f081b668766042e7490e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_sleep </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga66c400929925784dba020d671154978a">rt_tick_t</a>&#160;</td>
          <td class="paramname"><em>tick</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will let current thread sleep for some ticks.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tick</td><td>the sleep ticks</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RT_EOK </dd></dl>

</div>
</div>
<a class="anchor" id="ga6b18459cac67e3695447e69b997fc74e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_delay </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga66c400929925784dba020d671154978a">rt_tick_t</a>&#160;</td>
          <td class="paramname"><em>tick</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will let current thread delay for some ticks.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tick</td><td>the delay ticks</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RT_EOK </dd></dl>

</div>
</div>
<a class="anchor" id="gaec4d1d7bababdead1e82fa880ac1c6ea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will control thread behaviors according to control command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the specified thread to be controlled </td></tr>
    <tr><td class="paramname">cmd</td><td>the control command, which includes RT_THREAD_CTRL_CHANGE_PRIORITY for changing priority level of thread; RT_THREAD_CTRL_STARTUP for starting a thread; RT_THREAD_CTRL_CLOSE for delete a thread. </td></tr>
    <tr><td class="paramname">arg</td><td>the argument of control command</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RT_EOK </dd></dl>

</div>
</div>
<a class="anchor" id="gab75228a43588dc35570bce6a2c18f3f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_suspend </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will suspend the specified thread.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the thread to be suspended</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error</dd></dl>
<dl class="section note"><dt>Note</dt><dd>if suspend self thread, after this function call, the <a class="el" href="group___thread.html#gae9f99bb5e2e2032b10ddda7a03eefe24">rt_schedule()</a> must be invoked. </dd></dl>

</div>
</div>
<a class="anchor" id="gab4f29aff4fec96d92f6321fa7b00c379"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_thread_resume </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__thread.html">rt_thread_t</a>&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will resume a thread and put it to system ready queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>the thread to be resumed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on OK, -RT_ERROR on error </dd></dl>

</div>
</div>
<a class="anchor" id="ga8a0288d712bd2d99d11231d4b073c5f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_thread_timeout </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>parameter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function is the timeout function for thread, normally which is invoked when thread is timeout to wait some resource.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parameter</td><td>the parameter of thread timeout function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga789a0782597b4d7f7c6c16eacc6084a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__thread.html">rt_thread_t</a> rt_thread_find </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will find the specified thread.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of thread finding</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the found thread</dd></dl>
<dl class="section note"><dt>Note</dt><dd>please don't invoke this function in interrupt status. </dd></dl>

</div>
</div>
<a class="anchor" id="gae0dcacf89c3d97272b185f7162a3e0c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_thread_idle_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize idle thread, then start it.</p>
<dl class="section note"><dt>Note</dt><dd>this function must be invoked when system init. </dd></dl>

</div>
</div>
<a class="anchor" id="ga47689b07705c1e7892f6ec397152e9ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_thread_idle_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(void)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function to idle thread loop.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the specified hook function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>the hook function must be simple and never be blocked or suspend. </dd></dl>

</div>
</div>
<a class="anchor" id="ga5aa2c0c67999e20ce8693ad3c8e624f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_system_scheduler_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize the system scheduler </p>

</div>
</div>
<a class="anchor" id="ga9aa8a561e0caf5e13126834c4f4bb681"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_system_scheduler_start </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will startup scheduler. It will select one thread with the highest priority level, then switch to it. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 6 2014 23:05:02 for RT-Thread RTOS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
